package com.wwg.myapplication;

/**
 *wwg 2025.8.13
 * 水波润屏动画配置类
 * 用于调整各种动画参数，便于后续调优
 */
public class RippleAnimationConfig {
    
    // ===== 水滴相关配置 =====
    public static class DropConfig {
        // 水滴数量
        public static final int DROP_COUNT = 6;
        
        // 水滴基础大小
        public static final float DROP_SIZE_BASE = 60f;
        public static final float DROP_SIZE_VARIATION = 40f; // 大小变化范围
        
        // 下落速度
        public static final float FALL_SPEED_MIN = 0.2f;
        public static final float FALL_SPEED_MAX = 0.5f;
        
        // 水滴形变参数
        public static final float MAX_DEFORMATION = 0.3f; // 最大拉伸程度
        public static final float ROTATION_SPEED = 2.0f;  // 旋转速度系数
        
        // 拖尾效果
        public static final int TRAIL_SEGMENTS = 6;
        public static final float TRAIL_LENGTH_FACTOR = 25f;
        public static final float TRAIL_ALPHA_BASE = 0.15f;
    }
    
    // ===== 涟漪相关配置 =====
    public static class RippleConfig {
        // 基础透明度
        public static final float BASE_OPACITY = 0.7f;
        
        // 涟漪大小
        public static final float BASE_RADIUS_FACTOR = 0.15f;      // 基础半径系数
        public static final float VARIATION_RADIUS_FACTOR = 0.1f;  // 变化半径系数
        
        // 物理参数
        public static final float INITIAL_VELOCITY_BASE = 1.5f;
        public static final float INITIAL_VELOCITY_VARIATION = 0.8f;
        public static final float ACCELERATION = -0.6f;
        public static final float DAMPING_FACTOR_BASE = 0.88f;
        public static final float DAMPING_VARIATION = 0.08f;
        
        // 表面张力和不规则性
        public static final float SURFACE_TENSION_MIN = 0.2f;
        public static final float SURFACE_TENSION_MAX = 0.4f;
        public static final float IRREGULARITY_MIN = 0.02f;
        public static final float IRREGULARITY_MAX = 0.08f;
        
        // 淡出控制
        public static final float FADE_START_PROGRESS_BASE = 0.5f;
        public static final float FADE_START_VARIATION = 0.2f;
        public static final float FADE_RATE_MIN = 1.5f;
        public static final float FADE_RATE_MAX = 2.5f;
        
        // 次级涟漪触发阈值
        public static final float SECONDARY_TRIGGER_PROGRESS = 0.25f;
        public static final float SECONDARY_MIN_AMPLITUDE = 0.6f;
        public static final float TERTIARY_TRIGGER_PROGRESS = 0.5f;
        public static final float TERTIARY_MIN_AMPLITUDE = 0.8f;
    }
    
    // ===== 层次效果配置 =====
    public static class LayerConfig {
        // 主层参数
        public static final float MAIN_LAYER_SPEED = 1.0f;
        public static final float MAIN_LAYER_DELAY = 0f;
        public static final float MAIN_LAYER_THICKNESS_BASE = 6.0f;
        public static final float MAIN_LAYER_THICKNESS_FACTOR = 4.0f;
        
        // 次级层参数
        public static final float SECONDARY_LAYER_SPEED = 0.75f;
        public static final float SECONDARY_LAYER_DELAY = 0.08f;
        public static final float SECONDARY_LAYER_THICKNESS_BASE = 4.0f;
        public static final float SECONDARY_LAYER_THICKNESS_FACTOR = 2.5f;
        
        // 第三层参数
        public static final float TERTIARY_LAYER_SPEED = 1.2f;
        public static final float TERTIARY_LAYER_DELAY = 0.15f;
        public static final float TERTIARY_LAYER_THICKNESS_BASE = 2.5f;
        public static final float TERTIARY_LAYER_THICKNESS_FACTOR = 1.5f;
        
        // 扩展层参数（高撞击强度时）
        public static final float SLOW_LAYER_SPEED = 0.4f;
        public static final float SLOW_LAYER_DELAY = 0.25f;
        public static final float FAST_LAYER_SPEED = 1.5f;
        public static final float FAST_LAYER_DELAY = 0.05f;
        
        // 扰动参数
        public static final float MAIN_TURBULENCE = 0.8f;
        public static final float SECONDARY_TURBULENCE_MIN = 0.3f;
        public static final float SECONDARY_TURBULENCE_MAX = 0.7f;
    }
    
    // ===== 地形配置 =====
    public static class TerrainConfig {
        // 地形点数量
        public static final int TERRAIN_POINTS = 20;
        
        // 基础高度
        public static final float BASE_HEIGHT = 0.6f;
        
        // 高度变化范围
        public static final float HEIGHT_VARIATION = 0.2f;  // 正弦波变化
        public static final float RANDOM_VARIATION = 0.15f; // 随机变化
        public static final float RANDOM_OFFSET = 0.075f;   // 随机偏移
        
        // 水滴分布范围
        public static final float DROP_DISTRIBUTION_START = 0.1f;  // 10%
        public static final float DROP_DISTRIBUTION_WIDTH = 0.8f;  // 80%
    }
    
    // ===== 动画时序配置 =====
    public static class TimingConfig {
        // 总动画时长
        public static final long TOTAL_ANIMATION_DURATION = 12000; // 12秒
        
        // 文字显示时序
        public static final float TEXT_FADE_IN_START = 0.4f;   // 40%进度开始淡入
        public static final float TEXT_FADE_IN_END = 0.7f;     // 70%进度完全显示
        public static final float TEXT_FADE_OUT_START = 0.7f;  // 70%进度开始淡出
        
        // 水滴生成时序
        public static final float DROP_GENERATION_END = 0.6f; // 60%进度停止生成新水滴
        
        // 背景效果时序
        public static final float BACKGROUND_FADE_FACTOR = 1.2f;
        public static final float BACKGROUND_ALPHA_BASE = 0.3f;
        public static final float BACKGROUND_ALPHA_VARIATION = 0.2f;
    }
    
    // ===== 性能配置 =====
    public static class PerformanceConfig {
        // 帧率控制
        public static final int TARGET_FPS = 60;
        public static final long FRAME_TIME_MS = 16; // 1000/60
        
        // 渲染优化
        public static final float MIN_VISIBLE_ALPHA = 0.01f;   // 最小可见透明度
        public static final float MIN_VISIBLE_RADIUS = 1.0f;   // 最小可见半径
        
        // 内存优化
        public static final int MAX_RIPPLES = 20;  // 最大同时存在的涟漪数量
        public static final int MAX_DROPS = 8;     // 最大同时存在的水滴数量
    }
    
    // ===== 颜色配置 =====
    public static class ColorConfig {
        // 水滴颜色
        public static final int DROP_COLOR = 0xAAFFFFFF;
        public static final int DROP_GLOW_COLOR = 0x55FFFFFF;
        public static final int DROP_HIGHLIGHT_COLOR = 0xF0FFFFFF;
        public static final int DROP_SECONDARY_HIGHLIGHT = 0xAAFFFFFF;
        
        // 涟漪颜色
        public static final int RIPPLE_BASE_RED = 255;
        public static final int RIPPLE_BASE_GREEN = 255;
        public static final int RIPPLE_BASE_BLUE = 255;
        public static final int RIPPLE_COLOR_VARIATION = 5; // 每层的颜色变化
        
        // 背景颜色
        public static final int[] BACKGROUND_GRADIENT_COLORS = {
            0x5DFFFFFF, 0x3DFFFFFF, 0x1AFFFFFF, 0x00FFFFFF
        };
        public static final float[] BACKGROUND_GRADIENT_POSITIONS = {
            0f, 0.4f, 0.8f, 1f
        };
    }
    
    // ===== 调试配置 =====
    public static class DebugConfig {
        // 是否启用调试信息
        public static final boolean ENABLE_DEBUG = false;
        
        // 是否显示涟漪中心点
        public static final boolean SHOW_RIPPLE_CENTERS = false;
        
        // 是否显示地形线
        public static final boolean SHOW_TERRAIN_LINE = false;
        
        // 是否启用性能监控
        public static final boolean ENABLE_PERFORMANCE_MONITOR = false;
    }
}